home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: news.ridgecrest.ca.us!owens!mcclung
- From: mcclung@owens.ridgecrest.ca.us (Scott McClung)
- Subject: Re: Alignment restrictions...
- X-Nntp-Posting-Host: owens
- Message-ID: <DKyBK5.5r6@ridgecrest.ca.us>
- Sender: usenet@ridgecrest.ca.us (Ridgenet Usenet admin)
- Organization: Science Applications International Corporation
- References: <DKxHxG.EK1@ridgecrest.ca.us> <821232137snz@genesis.demon.co.uk>
- Date: Wed, 10 Jan 1996 06:04:53 GMT
-
- In article <821232137snz@genesis.demon.co.uk>,
- Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
-
- > What are the byte order conventions in the 'image file'? What you
- > have here assumes big endian while the code at the top just assumes
- > the byte order is the same as the target variable. In the latter
- > case this problem is easily solved by:
- >
- > memcpy(&value, ptr, sizeof value);
-
- Big endian. The files are RLA images, animation frames, generated
- by Composer from WaveFront. The program converts RLA to YUV.
-
- > I suspect that the tailored inline code that a good compiler can
- > generate for memcpy, especially with a fixed, small size would be
- > difficult to beat.
-
- I guess I'll check the assembly output of the compiler to make sure
- that it's really putting the memcpy() calls inline. Often I'm not
- aware of what optimizations the compiler I'm using is capable of,
- beyond the basics, so it seems easier to assume that it will generate
- sub-optimal code in situations like this. That's why I took the
- original memcpy() calls out, actually, and started trying to optimize
- some of these simple operations.
-
- Thank you very much for the advice.
-
- --
- /* Scott McClung Opinions expressed here are mine.
- * UNIX Software Engineer/UNIX System Admin
- * mcclung@imt.saic.com
- * mcclung@ridgecrest.ca.us
- */
-